package cn.wolfcode.luowowo.common.util;

import lombok.Getter;
import lombok.Setter;

/**
 * Created by LENOVO on 2019/8/7.
 */
@Getter
@Setter
public class AjaxResult {
    private boolean success=true;
    private String msg;
    private Object data;

    private int code;//错误原因的代码



    public AjaxResult(){}
    public AjaxResult(boolean success){
        this.success = success;
    }



    public AjaxResult(boolean success,String msg){
        this.success=success;
        this.msg=msg;
    }
    //成功
    public static  final AjaxResult SUCCESS = new AjaxResult();
    //失败
    public static  final AjaxResult FAIL = new AjaxResult(false);

    public AjaxResult addData(Object data){
        this.data=data;
        return this;
    }
}
